﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using RPGXEngine;

namespace RPGX.Scripting.SystemFunctions
{
    public static class SystemFunction_HUDLoad
    {
        public static IVariableType Method(ScriptManager sm, FunctionScope scope, List<IVariableType> data)
        {
            if (data == null || data.Count != 1)
                return sm.Zero;

            IVariableType res = sm.True;

            string fileName = data[0].Value.ToString();

            try
            {
                Game1.Instance.HUD.Load("data\\settings\\hud.set", fileName, Game1.Instance.Graphics, Game1.Instance.GameText, sm);
            }
            catch (Exception)
            {
                res = sm.False;
            }

            return res;
        }
    }
}
